Joe Root hit 228 to put England in a strong position despite a late Sri Lanka fightback on day 3 at Galle.