How does an aircraft derive winds aloft on its own?
Yes, you are correct. You need three pieces of information:


airspeed
true compass heading (considering magnetic variation)
multiple absolute position fixes (eg. from gps)


The aircraft heading has to be measured by a compass within the aircraft (it can't be derived from the gps track), and the gps position can be used to look up the local magnetic variation. The difference between the speed/heading and the ground track (in straight and level flight, anyway) is attributable to winds aloft.