I assume you know how to detect a high/low input in your sketch...
You've got one simple issue do deal with... You can't put 12V into the Arduino. You just need to drop that 12V down to 5V at the Arduino input (without affecting the other stuff that's connected to 12V).
If your "transformer" is putting-out DC, it's actually more than a transformer, and that's good, since you can't put AC (or negative voltage) into the Arduino.
I'm going to describe this in words because I although I've been working in electronics for a long time, I don't have any schematic-drawing software.
I'm gonna' have to get 'round to that...)
Put a resistor (~10k would be good) between the 12V from the transformer and one of the Arduino's inputs. Then connect a diode between the same input and the Arduino's regulated 5V power supply (i.e. the "5V" pin), with the anode on the input (i.e. "point" the diode toward the 5V supply). Any regular silicon diode will work, since there is very little current through the 10k resistor.
Whenever the voltage goes above 5V (plus the ~1/2V drop across the diode), the diode "turns on" and "clamps" the voltage at 5V (plus the diode drop). The "remaining" ~7V gets dropped across the resistor.