Songs of the Earth by Elspeth Cooper.
The protagonist is Gair. When we meet him he has just discovered he has magic powers, which is a death sentence since witches are burned at the stake. He is caught, tried and condemned, but his sentence is commuted to banishment. He is found by Alderan and taken to the school of magic in the town Pencruik on the Western Isles, where amongst other things he learns so shapeshift.