Torx T25
Inside a hub motor you have phase winding and three Hall sensors which are positionong feedback. The BLDC controller or the LCD calculates speed using pulses from the Hall sensors
Another wau to calculate speed is to put a magnet on a spoke and a hall sensor pickup on a stay and count RPM, then multiply by wheel circumference.