Yep, whatever that transformer is, it doesn't have anything to do with your phones. Probably the door bell or furnace. Just because whoever installed it used phone wire doesn't mean it is a phone thing.
Your problem is a high resistance short in the house wiring that arcs over with ring voltage and shorts. You have received some good trouble shooting info here, follow it and you will find the real problem.
Your problem is a high resistance short in the house wiring that arcs over with ring voltage and shorts. You have received some good trouble shooting info here, follow it and you will find the real problem.