The datasheets will usually provide an indication, though it may be subtle:

Techniques for designing with such products will vary. A suitable thermal interface qualified for use as an insulation layer is a likely option, both for functional purposes and to avoid turning the heatsink into an antenna that will cause a failure to meet radiated emissions standards. Depending on the application and applicable standards, such a heat sink is often isolated within a device chassis, or connected to a circuit node that will cause a fuse or similar protection device to open in the case of an insulation failure betweent the transistor and heat sink.