Think as if your elbows are glued to the side of you. Ellen Molin's idea is really good. Just try to be always conscious of it
Use a big rubber band (one used for exercise) and hook it around your elbows so that it goes behind your back, keeps your arms in palce but it still has some give to be able to move with the horses head
The nice way is to imagine that your arms are stuck with velcro. Enough that it doesn't come away from your body, but there's still a bit of movement that allows your hands to go with the horse's head.
If that doesn't work, there's the slightly less nice way of putting the whip horizontally behind your back and hook your elbows around it. It's usually used for people who carry their hands too far forward but should also prevent you flapping your arms around until you develop muscle memory.