The expression "if so" is certainly used in more formal settings than informal. The real issue is making sure you use it correctly so as not to sound rude.
Your example:
"you must have received a confirmation email about the training. if so, could you please provide me with the attached invoice?"
My first problem with this is that it doesn't quite make sense - "you must have" implies certainty, so why would you say "if" you have received it...? If they must have received it, there is no "if" about it!
If you are sure that a confirmation email went out but you want to allow for the possibility that they might not have received it, you might say instead:
You should have received a confirmation email about the training. Please can you provide me with the attached invoice?
"Should" allows for the possibility they didn't receive it. Adding "can you" makes the request seem a bit more polite.
If receiving the email is only a possibility, then make the entire statement conditional by saying:
If you have received a confirmation email about the training, please provide me with the attached invoice.
With either of these suggestions, you may wish to add a follow-up statement detailing what the recipient should do if they haven't received an email, for example:
If you have not received a confirmation email, please get in touch.