This huge dragon can be tricky to defeat.
In the first stage, learn the movement pattern - the dragon will rear back and then breathe magic at you. Jump and press B to use the grapple, avoiding the magic by swinging. When the breath stops, the dragon will lunge at the cliff - dodge out of the way and then dodge back to attack it. Get as many hits as you can before it breathes again.
When you have reduced the energy bar by more than half, run towards the dragon and follow the button prompt to leap onto its head and attack the eye.
This will trigger the cutscene and the second half of the battle. You are on a narrow platform with the dragon ahead of you. It will continue to breathe magic and attack in a set pattern. When its head is low, attack it and force it back.
When the energy bar is low enough, the dragon will be under the falling flames and can be killed by following the button prompt.
Winning this battle unlocks air magic (LB and A).