When you connect a boat to the shore it acts like a magnet to stray current that may emit from other boats or marina infrastructure.  This may cause the erosion of your boat through electrolysis.  Going back to physics class we learned that a transformer was a means of transforming one voltage to another by having two electrical coils in the same proximity.  The isolation transformer works in exactly the same way but the voltage doesn’t change.  But it does mean that there is no common earth between the land and the boat. Therefore stray current cannot pass from the water to an earth on the land. There is another device called a galvanic isolator which has a similar purpose to the isolation transformer but is much less effective.