Is it ok to split a transformer directly off the wiring from an outlet junction
That should be fine, it looks like that's just a general purpose receptacle and it's OK to add a small load like a doorbell transformer to that circuit.  It looks like there's room in the box, and clearance so the transformer will fit.