X2 caps

What is the secondary voltage of the transformer?
What is the worst case (highest) voltage that one could get from that transformer?

Multiply that worst case value by sqrt(2).

Select a capacitor that can take that 1.4times highest voltage.

eg dual secondary 25+25Vac, has a worst case output of ~254/230*(25+25)*(1+regulation) ~ 60Vac
Times 1.4 equals 85V

Select a capacitor that can take >=100V
It will never fail due to overvoltage.
 
You don't need an X2 cap on the secondary side, as failure here has less catastrophic consequences than a short across the mains. Just pick a cap with DC rating about twice the peak AC voltage.

O.K. guys, this is across the secondary and I have those caps handy, I will use them. I added something new to my quite limited electronic knowledge.

I couldn't see why it would make any difference as to cap quality because AC noise is AC noise but I see now.