The 4 legendary ships are in the corners of the map, and are exposed when you unlock the relevant portion of the map. Have a fully upgraded ship prior to beginning. You will not succeed easily without it. Also note that you will be fighting each of these encounters in a storm. I have ordered the following notes in order from my perceived level of difficulty, from easiest to hardest.
The lower right location was the easiest to me; the ship is a standard man-o-war, just a little stronger. Stay out of the mortars, and fire away.
The lower left location has a heavily reinforced hull, but is susceptible to ramming and fire from the rear. Stay away from its cannons, and get behind it if at all possible.
The upper left location is a speed demon that attempts to ram you at every opportunity. Its ram is deadly and will take about a quarter of your health, so circle it quickly and fire at every opportunity.
The upper right is actually 2 man-o-wars. Bring the 2 of them down equally. The first one to go down will go into a frenzy, and become much like the ship in upper left corner. Keep your distance and fire away, and they'll all be down in no time.