Smart Thermostat and 24 volt transformer direct to thermostat
The two new 24V transformer wires will be R and C, but wait.  We don't know which one is which. 

It's a 50% chance, so guess. Hook up New R Only -- do not hook up New C.   Now, measure voltage from New C (which you haven't hooked up yet) to W, Y and G.  You should see near 0V, or 24V if the system is cycled on.  If you see any voltages over 24V, particularly if you see 48V, then you guessed wrong. Reverse New C and New R. 

Once you have them identified, use colored tape to mark R as Red and C as Blue.