PCB thermal isolation from 230VAC-12VAC transformer
Fiberglass (PCB material) is not a great thermal conductor, but it is not a great thermal insulator either. The only way to thermally isolate parts is to increase the distance between them, or connect them with a material with higher thermal resistance. Generally air is a better thermal resistor than FR4.

One solution is make the pcb bigger and put the other components further away from the transformer.

Another is make a 2nd pcb and connect it to the first pcb with a connector that leaves an air gap between them. I'm suggesting this solution in case you can't expand the "footprint" of the board beyond the size of the transformer.