Magnesium anodes are normally used in fresh water. They may not be recommended for aluminium hulls though. They will waste away very quickly in salt water.
Zinc or aluminium anodes are used in salt water (not sure but i think zinc may be preferred for aluminium hulls but if so i dont know the reason off hand)
Zinc and aluminium anodes become coated with oxide (or basic carbonate deposit ?? ) in fresh water which renders them ineffective.
I note however that for aluminium hulls in fresh water they suggest you contact them for advice. I think that would be wise rather that relying on opinions expressed here (including mine)
The basics of galvanic corrosion are that an electrical current is set up between dissimilar metals. The nobler will become the cathode and the less noble will become the anode. Exactly the same as a battery and the process that is used in plating with Zinc, chrome etc. Therefore, in the simplest terms whatever your hull/underwater metallic equipment is made from you need something that is less noble to protect it.