I've had a problem with this for years, and gear or not the harder I train the worse it gets; however, it did always seem to be a bit more sensitive with gear, but that's due to the way gear enhances your metabolism which will make sense in a moment.
Like you, I assumed I needed more potassium, but this never helped; in-fact, it seemed to make it worse. The cramps ended up getting so bad that I had to go to the doctor...I would get them in my back, arms and abs at the same time...all three areas along with my legs cramped up all at once on one occasion...the pain was so intense I threw up.
Anyway, after a trip to the doctor, it ended up I had a sodium deficiency, and by taking potassium I was throwing my electrolytes out of balance even more. Due to the way my body metabolizes sodium I need more than the average man, and if I'm using gear, as this enhances metabolic activity I'd need even more.
From there I started taking sodium capsules...it took awhile for this to remedy the problem but it did help some from the get go and after about a month the problem was gone. Also, even with the sodium caps, if I consume too much caffeine, as caffeine is a diuretic this can bring the cramps back but not as strong. So something like red bull as one person mentioned is probably not a good idea.
My advice, sodium caps...better advice, find a sodium cap that will help balance your electrolyte levels, limit caffeine intake and drink a lot of water. Even today, even though I don't cycle anymore I still have to do this and it makes a big difference.