The transponder is a radio transmitter. It transmits (responds) when it receives an interrogation signal from a radar head or an aircraft equipped with active TCAS. The basic output is mode A which is the ID code that is set on the transponder face i.e. 1200 for VFR or as assigned by ATC. If the transponder is capable of Mode C, it needs an external source for the altitude data - an encoder.
The encoder is a barometric device calibrated to standard ISA sea level i.e. 1013.2 and is set and checked as part of the RAD, whatever it's number is, check every two years - It is not user adjustable. The altimeter is adjustable and is checked and adjusted to correct local QNH before every flight. This can be done using either the kollsman scale with the reported QNH for the location you are at or by using the published airfield elevation set on the altitude scale.
If your transponder displays its altitude output you may notice that it is seldom the same as what your altimeter is reporting. This is the difference between 1013.2 and the actual QNH in the area you are in. I believe that the radar consol is aware of the QNH for each area and displays transponder returns to the operator as a corrected altitude.
Ok, off we launch and are tootling around and we hear centre reporting an unverified paint at 3000 feet, 10 miles east of the airfield to an inbound RPT as a possible conflict. That's where we are, so it's probably us. Being good aviators we chirp up and give a position report of our location (xx miles east of the airfield) and altitude (3000 ft) and intentions. Bingo! we're now verified!
* There's been a couple of replies since I started typing this.