Had same issue for years especially when bird hunting in heavy cover.
Assumed it had to do with wearing heavy boots and slogging through thick
ground cover. Always happened at night during sleep. Best thing I found was
a percussion massager and use it prior to hunting and as soon as I finished.
Tried extra stretching and never could stick to it long enough to see if it would
help. The pain was some of the most excruciating I’ve ever experienced and this
has eliminated any issues. I still can tell when they are starting to tighten up,
especially in turkey season, and I go ahead and start using massager about 2
minutes at a time several times a day.