Lots of good information here, I put together the parts to convert my hydro Ultegra to Di2 ultegra over the winter. I’m not familiar with the speedmax specifically but you should be able to convert it, placing the battery inside the seat tube, and the wifi unit are things to consider for a cleaner look. Some have issues routing cables around the BB as well I believe.
Basically, only the cranks carry and the brakes carry over, assuming you stay with the same groupset manufacturer. With SRAM, you will need your derailleurs and your shifters. You may want to consider blips for when you are out of your aero position. Should you go for wireless blips, then no cabling is required.
With Shimano, you will have to install the battery, route the wires, etc. Meaning, you will have to install more parts — assuming you are doing it yourself.
Have you thought about your power meter options? If you went for Rotor cranks, then you’d be “groupset neutral”. Their cranks are very light, super stiff and their power meters are bang on accurate outdoors.
Will this be cheap? No, probably not. You could save some money by getting e. g. a Rival AXS eTap rear derailleur. Which is better, SRAM or Shimano? I don’t think there is a clear winner. If you want to install the groupset yourself, SRAM’s wireless groupsets are hard to beat. Given that this is a tri bike, you could even keep your Shimano breaks if you wanted to.
Due to a broken shimano Ultegra r8020 shifter I upgraded to sram axs force with red crank, total cost was around 1800 euro for parts (force group, red crank, bottom bracket, chain, cassette, hub) and some 150‐200 for installation (had some other maintenance done too)
Hub change, shimano hollowtech crank removal and brake hose cutting and bleeding require special tools