Make sure you release throttle completely when you brake. A lot of riders inadvertently don’t close throttle, or actually increase throttle under hard braking.
Are you using rear brake? You want to initially grab both. Then gradually let off rear as it gets light while you increase front brake. It could be rear tyre locking up and sliding around that you’re feeling.
Try using only front brake only, is bike more stable? Under maximum deceleration, very little braking force comes from rear tyre due to minimal weight on it. So most braking force comes from front.
One thing to check is rear & front wheel alignment using string test.