Welcome to the tractor forum.
I had an old MF 150 tractor that used to do that. As RC says, it is due to a worn shift mechanism. A MF mechanic showed me how to fix the problem on my 150, dunno if it will work on your 245, but it's worth a try.
Pull the transmission oil filler cap and peer into the transmission. You will see one shift fork out of alignment. Take a big screwdriver and push the fork back in place.