tor to run continuously as soon as I am connected.
How does TAILS manage to start tor automatically?
Tor Stack Exchange is a question and answer site for researchers, developers, and users of Tor. It only takes a minute to sign up.Sign up to join this community
It's installed as a system service, the same way as is defined here.
It's started automatically at boot by systemd, the system service manager.
Tails also has extensive configuration and tweaks for it to use Tor properly, simply installing Tor won't provide the same features but it will start automatically when the operating system starts.