The problem with cramps is, as you see from comments above, there is no one cause or solution. Everyone seems to be different. I’ve had similar issue to you in past, and funnily enough coming back again in last 12 months, where I’ve had trouble isolating the cause.
Some remedies you might want to try:
Tonic water before a ride (night before OK)
Pickle juice before a ride (seriously!)
Hydrate hydrate hydrate – night before and during ride
Salt tablets (High 5/SIS/etc OK)
Slight raise or lower your stem – try raising it 5mm or so first
My own belief is cramping is primarily caused by lack of hydration. Once you can eliminate that as a cause, my own experience has been slight adjustments to position on bike usually resolve.
Good luck. I’ll be watching this thread for any other tips for myself!