It isn't necessary to set your attack to Z, but it gets you a farther slide more easy and more often than Z to throw. But it'll be alot easier if you do set it to that
.
Anyway, steps to Boost Smash.
1) initiate a dash.
2) perform a dash attack. Usually it's done by smashing down on the cstick, but it's perfectly possible to press A and get it too. Again, smashing c-stick down is easier.
3) immediately after the dash attack comes out, slide your direction stick from your dashing forward position to a upward diagonal forward position (move it from 3 o' clock to 2 o'clock) and at the same time press the Z button (or other attack button).
Actually, what should make it easier is after you start the dash, immediately shift your directional stick to the 2 o'clock position even before you perform your dash attack. The closer you can perform the dash attack and the up smash, the farther your slide should go.