It seems to me that 99% of the time people slide out on rails, jibs, and even land backseat, it's due to the same thing...fear.
I bet if you go a little faster, mentally commit and visualize the trick, focus on the end of the box, slightly bend your knees, keep your arms by your side and in front of you, you'll stomp.
As far as leaning forward goes, I'll say this: Keep your feet underneath your hips and shoulders. Don't let your feet get out in front, or you're guaranteed to slide out, unless you're filthy with your edge control and you're looking to roooooyale. If thinking about putting more weight on your front foot helps, than by all means.
Get a solid pop, and keep forward pressure on your boots so that you land on the box properly, as opposed to landing on the box backseat and watching your feet take off on you. I'll be redundant....Don't watch your feet!