At first have the crew offer little resistance and allow the pirates to climb onboard. As soon as the pirates are on deck, the SEALs fill 'em full of lead. Let one of the pirates live and allow him to go back to tell his buddies that the freighters are now dangerous.
Keep doing this on a consistent basis so the pirates won't know which ship is safe to take over. Gradually the attacks will stop.
Either it's this plan or the companies that own the freighters can hire mercenaries to protect their ships.
Q Ships.
Can’t think off a better plan to accustom new seals to killing.