Around here, the typical place for a doorbell transformer is near/at the electrical panel. This does look like a doorbell transformer, but I'm wondering why it would be connected to a single gang work box in the ceiling. Away from anything else. And presumably with the wire routed to/via a sub-optimal location to actually get to the doorbell, which is probably not upstairs.

No matter what it is, I think the installation is a little odd. Is your electrical panel in the garage Tony?
_________________________
Bruno
Twisted Melon : Fine Mac OS Software