I used to get this from time to time, but as soon as I started doing Kegel exercises it completely stopped.
I've concluded (at least for myself) that they were muscle spasms from weakened muscles. For instance if you're at a desk all day and never get exercise, you could possibly get back problems.
Try looking up Kegel exercises. Hope this helps.
-John