High dielectric strength temperature sensor (2500V)
Ideas:

A cheap temperature sensor and cheap voltage to frequency convertor driving a cheap opto isolator sounds like an option. The circuit at live potential has to reconvert frequency to voltage to obtain temperature.

There are temperature sensing devices that have a digital circuit ambedded that produce T to F. These can also be used to drive an opto. Look at Maxim's portfolio.

Make a pyrometer using an infra red photodiode pointed at the heatsink - use its output to determine heatsink temperature. You might need to look into material emissivity and black body radiation a tad but it's not impossible and could be very cheap if you have more than a soupçon of processing power up at live potential.