You hit X to dismount Yoshi and then press L right after to do a ground pound. Since you stop in mid-air when you ground pound, and since Yoshi stops in mid-air for a little bit after you dismount him, you go back onto him. This isn't as easy to do as it sounds because if you do it too early or too late, it won't work. You have to get it just right. I wouldn't say it's a glitch; I'd say that it's taking advantage of the physics engine.