ryat is correct. and additional info the StarBaseUpgradeRACEupgrade.entity files can have up to 9 upgrade levels, but the total upgrade limits are in the StarBaseRACE.entity.
in my personal megasb mod I have level 9 hull & shields, level 9 weapons, level 6 hangars & level 3 trade(tech only the other races get a level 2 trade) and 30 upgrades limit, and when I tried them with distant stars nasty pirates mod and diplomacy 1.001 in a little mod I was helping another modder with, two of my starbases could DESTROY a 50000 credit raid in diplomacy without the pirates even getting to the other structures typically withing 30 seconds, which allowed me to focus my fleet on optimum for slow expansion(porcupine style) play without even worrying or thinking about defence as anything that enters my gravwells that is NOT a friend is fried on the spot, yes insta-fry advent battleballs of entire fleet caps.
and it could take a huge pirate raid AND a races entire fleetcap to take one of my two starbase planets and the homeworld in that minimod had eight!!! megasb's.
harpo