If you just want to sense if AC is present, I would recommend using an opto-isolator
instead of a transformer. The opto approach is smaller and cheaper.

If you instead want to measure whether a load connected to the AC mains is ON or
OFF, you can still use an opto - but it takes a few more parts.