+1 on Pedal Wench's suggestion to have resistance.
To learn to get out of the saddle, I recommend starting on a flat road (somewhere quiet and safe).
Add resistance (shift to a harder gear). How many gears you shift will depend on the grade of the road.
Place your hands on the hoods.
Push the bike forward as you continue pedaling.
Stand, and balance your weight on the bike based on the grade of the road.
When you want to sit again, push the bike forward as you continue pedaling and allow the saddle to just move under you.
Hope this helps!
Lorri