Yeah i get it sometimes but not when im freestyling, best way to fix it is to do long stretches.
Like 30 secs each stretch, and hard stretches not pussy ones
My favourite groin stretch is sitting down with feet together, then leaning forward, hard to explain but its a great stretch.
Also if you do it, push your belly button to the ground not your back ;)