Paraphrasing from the MSF guide,
Apply both brakes all the time. (you must continually practice and develop the the skill to prevent the f/r tire from locking up under emergency braking conditions)
If the front locks - release
If the rear locks - tougher call, if you release and the f/r are not in alignment you will high-side, if you keep it locked you might low-side. If you release in alignment you might get out of it alright.
Keep safe.