It helps to know where your body likes to be while pedaling and to use this position when you pedal for any significant period of time on any bike.
It is important to note that this applies to pedaling situations only. There are a lot of situations on a mountain bike that you should have a lower seat position for safety as well as improved agility.
I always use a seat post quick release so I can adjust my seat height according to the riding conditions. It is helpful to mark the seat post where it enters the frame at the positions you like to use for quicker adjustment.
Take a moment before each ride to think about the trail and where you might want to set your seat height, and don't be afraid to adjust it while you ride.