There are 3 main methods
SRM Cranks which have a strain meter (don't know the correct term) in the bottom bracket.
Power tap.
Similar to SRM but located in the rear hub
Polar
Which is the least accurate which works on the movement of the chain and the cadence I think.