Keyframe-based CPG for Stable Gait Design and Online Transitions in Legged Robots