If you were running they would just call that a stitch and leave it at that. It's pinched muscles in your back for they often send pains around the body on the nerves to be pains in the sides or front of your body. When you are pedaling you are irritating the back muscles until they go into pain to go into the pain area. When you don't pedal the pressure is off that area so the muscles go back to a tight stage where they are ready to go back into pain if you make the wrong movements again, like pedaling. to get rid of this pain and to keep it from happening again you have to free up your back muscles and here's how to free them up:
(do from a sitting position)
Place your left hand on your left leg next to your body. Place your right hand over your left shoulder, fingers over the back and the palm in the front and firmly pull down on them and hold. After 30 seconds slowly lower your body forward and to the outside of your left leg, keeping your left arm fairly straight as you do. When you reach your lap remain there for another 10 seconds, release the pressure but rest there for another 30 seconds. Then reverse your hand positions and do your right side.
For best results relax your body first by taking a deep breath and exhaling then remain this relaxed.