By comparing a vector composed of true airspeed/magnetic heading to GPS ground speed/track.
The difference between the two is instantaneous winds aloft.
This is why, by the way, accurate winds aloft depend on a good magnetic calibration, and the OAT probe (for accurate TAS )