Machine learning reveals complex behaviours in optically trapped particles