I have recently started using 12-52 flatwound strings by Rotosound and I have managed to break three in a week, two of which were low E strings. As I begin to turn the machine head, the string starts to fray and eventually snaps. The frayed string is shown in the picture. Is anyone able to help me, am I doing something wrong?

The string is breaking at the machine head? Kind of odd. You should be giving the string some slack before you start winding the string around the machine head, i.e. the string is not flat against the fretboard. That way tension is not only on the point where the string enters the machine head but tension is dispersed from the extra winds around the machine head.