Mysql does not allow to store the tree structure.
Most likely then you will have to store the engines in a separate table and auxiliary table relationship many-to-many, and then do something like this:
Select * from boats limit 10; - choose the boat.
Further, these id boats gather in one line
Select * from engine_to_boats as etb as a left join engine e on etb.engine_id = e.id where etb.boat_id in 2,3,4,5,6,7,8,9;
And then, when you otrisovat, it prescribes their engines.
Of course, you can use ajax data field on the engines, but this is not good as it leads to denormalization of the database and with the same success it is better to use plain text.