It is shown/explained in Episode 8 of the first season. When the Professor explained to the team how they will escape, he mentioned a tunnel that he had dug 5 years earlier:
Professor: We’ll exit through another tunnel. A tunnel that they won’t be able to see. Because it is 26 metres from any other drain and, mainly, because it’s already there. We just need to make a hole in order to open it from here, from vault number three.
Tokyo: Who made that tunnel?
Professor: I had it built five years ago. Once you make the hole to connect the tunnel to the factory, you’ll find 486 metres already excavated to a hangar that has already been prepared.
After the explanation, the tunnel is shown, and we can clearly see the cable going down the tunnel from the hangar (where the professor operates) to the factory/mint.
It is not explained how exactly they got it from under the factory to inside the factory via the toilet bowl, but I imagine that won't be very hard to achieve once you get the cable right under the factory.