Looks like the TO220 part (TRIAC?) on the board has let the smoke out too. I wonder where the optocoupler comes into play in the circuit? Doesn't seem to have spared the rest of the circuitry from damage so it may not be for isolation?
Anyways, if I had to guess what happened here, the TRIAC failed causing a cascade failure which eventually ended up with the transformer burning up. Very bad circuit design if that is indeed the case.