The most common source is a "blind" encoding altimeter. It is a little box behind the pannel which acts like an altimeter set to 1013hpa and provides the transponder with the required info.
In a typical unpressurised GA aircraft it is simply open to the cabin but in some aircraft it may be part of the general static system.
Regards,
DFC