Not sure this can be blamed on TeamViewer.
Something dodgy (virus, nasty trojan or other vulnerability) has forced TV to be installed, and presumably dropped a bunch of preconfigured config which would put TV in as a service and listening. That config would have added your machine to some dodgy persons TV account, so they could drop in and use your machine. They then surf in at their leisure.
Having 2FA on your own Teamviewer setup means if they have YOUR username and password, they're still not getting into your TV account. However I don't know if you can set it so 2FA is required for each and every use of TV to remote to a machine on your account.
What they did to your machine once they had remote access - thats the kicker. What else did they payload, what have they stolen.
Something dodgy (virus, nasty trojan or other vulnerability) has forced TV to be installed, and presumably dropped a bunch of preconfigured config which would put TV in as a service and listening. That config would have added your machine to some dodgy persons TV account, so they could drop in and use your machine. They then surf in at their leisure.
Having 2FA on your own Teamviewer setup means if they have YOUR username and password, they're still not getting into your TV account. However I don't know if you can set it so 2FA is required for each and every use of TV to remote to a machine on your account.
What they did to your machine once they had remote access - thats the kicker. What else did they payload, what have they stolen.