Just pull out your bike on the edge of any greatly-slanted ground (like the Brinstar platforms or the edges of Yoshi's Island) in the direction of the higher end, and try to turn before you start moving anywhere.
As far as I know, it's random, but I was under the impression that you have a higher chance based on how fast you're going and how quickly you press the other direction to turn. I could be completely wrong, though.
These aren't really glitches, but, here are some bike-related quirks you might like to know.
The bike has ~20% HP, but it gets set back to the maximum if you ride it again, and it cannot take damage while you ride it.
The bike can normally be pushed by G&W's U-Air wind effect, but if you are riding it, it cannot.
Hard throwing the bike downward on slanted surfaces can cause some interesting bouncing effects. For example, throwing it down on the edge of Yoshi's Story will murder characters who rely on recovering low.