Transaction fees are calculated based on the total amount the client has paid.
If a Partner has set up their invoicing to include taxes, the transaction fee is calculated from the total amount which already includes taxes.
See this guide to Create and Apply taxes.
If taxes haven't been set up, the transaction fee is still based on the total invoice amount the client paid, but without taxes, since taxes wasn't indicated on the invoice.