I found a way to enable it only for observers/replays. I don't actually want it while I'm playing a game, but it's very useful when I'm watching replays. Other people might be interested in this so I will share the code here.
in your mod's gamemain.lua, at around line 80, there is this line of code:
CreateSelectionUI()
I added an if-then statement around it:
if isReplay or (GetFocusArmy() == -1) then
CreateSelectionUI()
end
I'm curious if ANYONE looks at selection cost while they're playing, or if they only look at it while they're watching a replay.