I taught a 6 person beginner class yesterday, 3 couples. I normally don't shoot .40 in beginning classes, but two of the couples just bought them a G22 and G23. By the end of the day they all were grouping fist size or smaller at 7 yards.
Two main things I'll work on to stop shot anticipation is first the trigger pull then a mental lesson to yourself. On the trigger let's say you have a 5# trigger, you're on target focused on the front sight and start the pull when you get about to about 4 pounds of pressure just slowly keeping adding more 4.4, .5, .6 etc. Don't think about pulling through, just keep adding a little more and little more. This will help to bring the surprise back to the trigger break.
The other may sound a little odd, but I can tell you from experience it works. It's not a mechanical shooting issue as much as it is a mental issue. It isn't a natural thing to have an "explosion" going off 2ft in front of your face. If you think about it it's probably more natural to flinch than not to flinch. Tell yourself; it is going to go bang, but that's ok, it isn't going to hurt me, I've done this many times and it hasn't hurt me, stay steady it won't hurt me. The recoil will happen, I'll recover from it and it won't hurt me.
You can practice both of these at home before and during dryfire. Then when you get to the range start out with these principles in mind and begin with slow fire. It will help.