How to detect electrical leakage in water tank?
This type of heater has a thin resistance wire inside a stainless/inconel/other corrosion resistant metal tube, insulated by a ceramic.

These elements normally have some leakage, especially as they age.

Measuring the leakage to the water is hard. You'd have to measure the two phase lines, accurately, and subtract to the the difference, or use a doubly wound transformer coil like in an RCD. Or isolate the water and put a resistor between the water and ground.

I expect for your purposes, earthing the stainless tube is you're best option, then any leakage will flow to earth, hazards avoided...