Upgrade modules are used for both ship and weapon upgrades. For weapons, it is simply a crafting ingredient. In the case of ship upgrades, a ship license must also be obtained.
Ship licenses are obtained by recruiting crew members. Once you've recruited enough crew members (2, 4, 6...) an overlay will appear showing you license and automatically starting a quest to visit Penguin Pete at The Outpost. Gather the appropriate number of upgrade modules, turn in the quest, and the ship upgrade will be applied.
Upgrade modules can be found randomly in the world (in containers) and can be found in reward bags (quest rewards).