Transponder Mode C
Mode C altitude transmissions are independent of the barometric altimeter sub-scale setting. The transponder can get its information from one of two sources: an encoding altimeter, which transmits a pressure altitude reading to the transponder or (more commonly) a blind encoder permanently set to 29.92 (pressure altitude). In either case, the altimeter setting does not affect the information sent which is always based on 29.92. ATC’s computers apply the current altimeter setting converting it to altitude (which will only match your indicated altitude if you have set the correct QNH).
FlySafe
PJ88