It can be two things! It can be just a bad habit that also appears on the ground, in the stall and out. Not just undersaddle. A lot of otbs struggle with this bad habit. Or it have be behavioral, the horse has learned when she tossed her head, she gets release. What you need to do is work on collecting with slight touches. Teach her when she gives to the bit, she gets release. Not when she tosses her head.
Work on contact exercises from the ground and on the lunge line. Draw reins help with the lunging so she gets used to it and then move to under saddle. Amelia Newcombe has a great dressage video on it
Try different bits, check your bridle fit to make sure it isn't pinching, make sure the bit is the right size and not too small where it could pinch her mouth, try a bitless/hackamore, check your noseband position or change nosebands
Maybe try changing the bit to a Nylon Snaffle