Replacing middle of circuit outlet with doorbell transformer
I think you're going to find that replacing the box with a two gang box is more difficult that just adding a new one.
Your black wires along with one from the transformer will be wire nutted together. You white wires along with a black wire from the transformer will be wire nutted together. Then connect your grounds.
The single box will be connected to the framing studs somehow. You'll have to get in there with a keyhole saw or hack saw blade to cut the supports. Be careful not to damage the cables in the wall or screw up the drywall or you'll be touching up paint.
There are two types of old work boxes. One has tabs that hole it in place but you have to follow the template exactly or the box won't fit securely. The other type has screws already mounted in the box and is meant to be screwed into a stud. Those, IMHO, are the better ones to use.  See picture below.