It is not necessary to use such capacitors on the primary side, i.e. when the large capacitor nearest to the mains input dies, just replace it with a normal electrolytic capacitor that matches or exceeds the original’s voltage rating and closely matches its capacity.
A place I worked at had a bunch of 19" Optiquest LCD monitors which ALL eventually died from a single bad cap on the power supply board. I fixed every one of those monitors, think it cost less than $10 to order the caps from digikey.
Leakage (ie, when a capacitor exhibits resistive properties by conducting current also when fully charged) can be measured easily by using an analog tester or a digital one plus a few parts, while the ESR (equivalent series resistance) measurement would need a proper instrument called ESR meter. The ESR is an unwanted static series resistance the capacitor would exhibit no matter the frequency it works at, it increases with aging and it's independent from the capacitive reactance which it's related to the frequency. Therefore, the lower the ESR, the better quality or condition is the capacitor.
However, you can just ignore the 2nd sentence if repairing a device would require just a bunch of capacitors; quality ones aren't that pricey, and if you find a bulged one, it is often advised to replace all capacitors employed in the same stage anyway. Some in fact can degrade without showing any visible hints of their condition.
Actually, even a quality capacitor will fail eventually, just not as early as the fake ones. As you have mentioned about the heat, the capacitor will be exposed to it and will fail because of it.
The 9 years old range hood in my kitchen is already had the start capacitor replaced twice. Whoever designed this unit decided to place the circuitry right in a hot spot, making sure that the capacitor will be gently toasted to death in a couple of years.
In another post here I mentioned fixing Optiquest monitors. The usual issue was you would press the power button and the power LED would flah for a second and... nothing. This is because the output cap of the switching supply would cease to filter the high speed square wave that goes through the transformer. So your DC power supply is now an AC square wave supply. Of course logic circuits don't like that so they will outright fail.
Sometimes there is enough capacitance via decoupling caps, ground planes on the PCB and local filter caps on the logic board so the initial power up works but once the load increases the ripple increases until it becomes AC again and everything goes haywire or shuts down.
If there aren't many, one can just replace all of them.
Defective capacitors are a common plague in modern electronics, and the culprit is always the capacitor: the market is literally invaded by rubbish quality capacitors, and swapping a bad quality one with another bad quality one guarantees it will fail again one day, so buy only reputable parts from reputable vendors; avoid online purchases of branded parts from unknown resellers (pretty sure that 99.999% of Nichicon or ELNA capacitors sold by any Aliexpress, Ebay, Amazon, etc. sellers are relabeled fakes); pay them more but pay them once. A web/image search for "counterfeit capacitors" works better than 1000 words.
Anyway, when shopping for (hopefully genuine) electrolytic capacitors, respect also the temperature ratings. Capacitors mounted into a power supply are exposed to higher temperatures, so always choose the 105c degrees type. Capacitance is usually not critical; electrolytic capacitors accuracy can be worse than 20%, and that's not a problem because they're not required to be accurate for their job, so if you don't find the exact value, you can safely swap the part with one with slightly higher capacitance; same for the rated operating voltage which can be higher (not lower!). Low ESR rated ones are preferred; if you can, buy them instead of generic ones.