Clean the shower head. If this doesn't work , buy a new shower head. As the showerhead gets blocked the water output slows down and the pressure builds up which make the water hotter and makes the thermostat switch on and off. My shower did this, and when the showerhead was changed it was ok.
Brian
May 2009