Starship: Like your exotsuit, adding a slot defaults to inventory, but you can click up above to pick a tech slot instead. You might have to fill out all existing rows before it will let you scroll down add slots to a completely new row
Corvette: At S-class you can have 6 rows. I wasn't able to add tech slots in the Corvette expedition directly, I had to use the trick of: add core items that use a slot, save, remove those items, save. For example you add 3 photon cannons (up to 3 count for stats, 4-on do not), save, delete, save, you now have 3 empty slots. Add 3 torpedo launchers and you'll get 4 new slots because it adds the weapon itself. I'm fine with doing this because I shouldn't be losing slots to landing gear, habs, the cockpit, etc.