The aircraft knows how much fuel is being used by the aircraft by from both engines fuel flow transmitters.
The aircraft also knows how much fuel is in the fuel tanks and what rate it is dropping through the fuel quantity indication system.
It will be the difference between these two parameters that will trigger the warning.
ie: If the L/H tank is dropping at 500 kgs an hour and the engine is using 250 kgs an hour then that difference is going somewhere.
There are no sensors around the pipes in the strut or on the engine.