The transformer converts the 240VAC to 27VAC. D1 rectifies this to 38VDC and C1 smooths the waveform somewhat. R3 and D2 regulate the voltage to 20V. R4 and R6 limit the current to the battery. The battery current passes through R5 and if the current is >~2mA, through TR1 Base-Emitter, which turns LP1 on brightly. If the current is <~2mA, TR1 will be pretty much off and LP1 will be dimmer (but possibly still glowing).