The same principles of weight transfer front/rear apply to a mountain bike.
To understand better, let's talk about cars - we're all maybe more familiar with cars than bikes.
There is this awesome rally game for the PC, Richard Burns (I still play it quite a bit) that teaches you that rally is all about weight distribution and it comes with a 'school mode' to practice this in all kinds of scenarios. It's the perfect simulator, since you can screw up many times without consequences.
When you corner a rally car at high speed, you need traction on the front wheels, but if you're also accelerating, the front is unloaded. The trick is to keep a foot lightly on the brakes while also accelerating - this will transfer some of the weight forward for cornering and also maintain the speed (and possibly help the rear around) due to the acceleration.
Another case well practiced in that game is loading the front tires before and during a corner: you have to be more or less on the brakes through most corners, to make sure there's enough grip on the front tires, to stay on the road.
There may be similar advanced techniques when racing a motorcycle, that I don't know yet and are out of the scope of this school.
Weight transferring to one side in a turn is also immediately obvious in drifting: they start the drift before the weight has shifted, since there is less traction on the wheels at that point. The way you start a drift is by turning the wheel rather swiftly and then, before weight has shifted, help the wheels loose traction with either the parking brakes or the power.