I grew up on dirt bikes and still do offroad. The key for both front and rear on any bike is to learn automatic reflexes, so that if you lock up, you release without having to think, before the slide gets out of hand.
When you lose the rear, it is a lot easier to get it back than the front.