Complex sentence: When the boat rolls, the rotation acts as an input to the gyro, causing the gyro to generate rotation around its output axis such that the spin axis rotates to align itself with the input axis.
Split into simpler sentences: When the boat rolls, it acts as an input to the gyro. This input causes the gyro to generate rotation around its output axis such that the spin axis rotates to align itself with the input axis.