Powering from a circuit and controlling it at the same time
Not easily if all you have is the two wires that the switch/relay control. This is because:


The power you consume must come through the door bell. This greatly limits the amount of power you can use.
As soon as the relay closes, the input to your power supply goes to 0 volts as it is shorted out by the relay.


Assuming you don't need too much power and the relay doesn't need to be held closed too long or too often, you can design a power supply with large capacitors to keep the voltage up.

Your better bet is to run an additional wire from the transformer.