This can be done at anytime, but you will need a decent sized convoy in order to win. Every so often you will notice a pirate flag appear on the nautical map. This indicates a pirate convoy is nearby. Search the area until you locate the ships then initiate the fight. As long as your convoy is more powerful, you shouldn’t have any trouble defeating the pirates. Once the battle is won, the achievement will unlock.
NOTE: This will unlock during the Adventurer campaign, as one of the missions requires you to defeat a pirate convoy.