Machine-learning prediction of tipping and collapse of the Atlantic Meridional Overturning Circulation