I think when to pull out regarding shields depends on whether you plan on having an extended engagement or whether you are in a must hold/almost done situation. If you pull out before your shields drop then they start recovering immediately. Otherwise, you have to wait out the penalty time for them to start recharging again. If you’re willing to absorb the penalty though, then my rule of thumb is once weapons notices their beams start firing noticably slower. At that point, you’re less able to mount an effective counter and you should pull out. Nothing says you can’t continue to harass them with homings, but pulling out of beam range once the beams stop being useful is probably a good thing.
As far as knowing when, it is something you should work on with your helm officer. I think that van Leigh and I have a decent rapport on this, but if you ever worry then you can always communicate and explain what you want. This also includes loading a mine to drop on your exfil route. I’m not sure I’d say trust unless you want to hand them and your XO the reigns to the ship while you worry about strategic level concerns, but certainly communication and instinct building so you both operate on the same page.
Also perhaps give thought and encourage your helm to think about how do you fix things if he decides to pull out before you’re ready. How quickly can he get back into it, what exit vector gives him the greatest number of options to get in or pull out further, etc. There are still times that I pull out before van leigh is ready, and that can be fixed by asking Engineering for a kick in the maneuvering boosters and heading back in, or if there is a way to take advantage of the terrain or some other fashion.