your safest bet is this...
Lock on to him. Keep your distance. Run large circles around him, but constantly JUMP and hold x. When you jump, your fire will hit automatically instead of having to aim, and you will build your unlimited meter very quickly this way. While doing this, look for the boss to light up, and rush in. He will follow up with another attack where he jumps into the air, and slams into the ground, splintering earth everywhere. JUMP when he is landing this attack. Then hold B to hit him while you're landing. Follow it with your launcher, and then of course the Y special attack.
If you only attack him after he lands that slam attack, you should be able to beat all his forms without getting hit. The downside is the battle will take a bit longer than normal because you're playing it safe, so you most likely won't get an S rank. But, if you're having a hard time just trying to beat him, this should help.