Identification of Mean-Field Dynamics using Transformers