Destroyers (and AEGIS Cruisers)
can "Detect Invisible", but only within 2 tiles of their location (i.e. a 5x5 diamond) while moving. Once sentried or fortified, their detection radius expands to 3 tiles (7x7).
But ordinary Subs (Mass Production) have M=4, and Nuclear Subs (Fission) have M=5 (Both M-values +1 if SEA, and/or +1 if the Sub's owner controls Magellans). Both Sub-types also have "Stealth Attack" against all ship-types, which means they can target Transports
without first engaging the escorts.
So stacking
all your Destroyers/AEGIS on top of your Transport(s) is not an effective anti-Sub tactic, since both Sub-types will be able to attack from beyond detection-range. All modern ships are bombard-capable, so the Destroyers/AEGIS can fire a single defensive shot against an incoming Sub — but IIRC Destroyers do
not have lethal Sea-bombard, so would not be able to sink a redlined Sub with that shot.
And since the AI knows where all your units are at all times, including empty 'decoy' Transports in your convoy may not work either, since the AI may be able to simply ignore them in favour of attacking the loaded one(s). Even if they can't then escape afterwards, at 100–140 shields, they are still a relatively cheap sacrifice vs. a Transport containing Tanks (up to 700 shields) or Modern Armor (up to 820 shields) — or an MGL (priceless!).
The best tactic would therefore be to (also) deploy a couple of Destroyers as outriders ahead and either side of your Transport-stack. Or, if the strait you want to cross is long/narrow enough, permanently station several Destroyers at either end of it, to prevent Subs from sneaking in. Then use your Destroyers (or Bombers) to damage/kill any enemy Subs that you spot,
before they can get close enough to attack your Transports.
(Alternatively, mod the game to enable all land-units — including MGLs — to be Airlifted...
)