Some heating-only thermostats are powered by the thermocouple that senses that the pilot is still lit. These generate very small voltages, in the millivolt range, and this is called a "millivolt system".
A cooling system will always use a transformer.
A combination heating-cooling unit, or a heat pump will usually have one transformer, but separate units may have two, which the appropriate thermostat will treat separately.