Generally in teamgames upgrading mexes starts very early (basically directly after your first few factories) and you have to do it alongside regular production.
First thing you should look for is reclaim; be super greedy and get it whereever you can (without stealing teammates starting reclaim of course). Don't overbuild t1 power before switching to t2 (15-20 pgens is usually more than enough, especially if you have a hydro).
When the midgame starts settling in (around 8 minute mark in most teamgames I suppose) you really want to pump some mass into your economy in preparation for the t3 stage. Things to note for are how long your engies will have to travel; simply setting up a que to a few engies to make all your mass storages is gonna take forever; do it in groups that are close together so they don't spend eternity walking.
What you also want to do at this stage is stop/pause all production that you don't need. Unless there is some heavy pressure from the enemy, you likely don't need to be building many units at this stage, just rely on surgical strikes to do damage and proper counters to defend yourself, be careful not to fall too far behind, scouting is important here.
Around this time you should also have about two t2 pgens. Once you have a little over 1000 power income you can start RAS, this will jumpstart you to t3 eco levels. While you're getting RAS bring most of your buildpower more or less together and get ready; once you've gotten RAS it's time to reclaim your t1 and t2 power and build either a t3 factory or a t3 mex, with the majority of your buildpower focusing on this project. After one is done do the other. How to tell which one to do first?
Scout your opponent -> Is he ahead on eco (and firepower on the field!) or behind? If he is ahead on eco that means you have catching up to do, likewise if he is so far behind that he poses no threat then you can safely choose eco. However, be wary of his upgrade timing as well, if he is getting t3 you need it ASAP. Generally you want to be in the first half of people in the match to get t3. Likewise if you see serious vulnerabilities against t3 raiding in your opponent go ahead and get the factory. When in doubt, I would personally choose the factory but always be open for the option of getting that t3 mex as it can make a huge difference in the long run.
Once your t3 factory is done make at least 2 t3 engies and have them make t3 pgens together in a safe location, it's nice to have an extra one make a few sams here and there too.
After that select the majority of your buildpower and have them upgrade the rest of your safe mexes to t3.
Once you have about 4-5 t3 mexes you can crank out the cheaper ground experimentals really fast, it's another decision point as you could also finish your last t3 mexes in this time; scout for threats and react to them properly. Another important factor at this point is to really start pumping out the buildpower (SCU's are generally a good choice!) as the only thing that will allow you to drain your full income is building experimentals or t3 arty. Also an important thing to take note of is that if you have a nuke launcher or antinuke, ALWAYS have some mass in the bank or it won't build the missile.
If you start getting your first t3 mexes around the 13-15 minute mark, you should be golden.
Extra notes; You can't stop ecoing, ever. If all your mexes are t3 then it's time to start another round; get a t2 shield close to your mexes (upgrade it to at least ed3 if cybran) and build t2 mass fabricators around your mass storages for even more income. If you've been building t3 power from the start you should be able to handle the energy drain just fine. If the game is still going, space is likely starting to be concern and thus RAS SCU's are your best bet. If you're Seraphim or there's plenty of space t3 pgens surrounded by massfabs are a relatively efficient option, but extremely volatile so you might want to shield them up.
That's about all I have to say about the basics of transferring from early to midgame, to lategame to superlategame. Hope it helps.