Cathodic protection is supplied by the use of sacrificial anodes. Fortunately for aluminum there are metals that are even less noble. They include magnesium, zinc and some aluminum, zinc alloys.
These metals can be made into sacrificial anodes. The anodes, when attached directly to an unpainted area of an aluminum hull, will protect any part of the hull that is not electrically isolated from the anode.
Which one is best? For most boats probably an aluminum/zinc alloy. Magnesium is too active in salt water but is sometimes used for fresh water applications. Zinc works well but can oxidize over when exposed to air. This means if zincs are not cleaned when a boat has been out of the salt and the boat is returned to the salt the oxidized coating will protect the zinc and it will not function as a sacrificial anode.
Some aluminum/zinc alloys will function well and not oxidize over so they are better for boats that may be periodically out of the salt water. Anodes do not last forever. Somewhere after 1/3 to 1/2 of the metal in an anode has disappeared it is time to replace it.