With the rapid development of 6G network technology and intelligent transportation system (ITS), the edge deployment and lightweight of network applications for modern users have gradually become a possibility. In this work, we propose a mobile intelligent vehicular task offloading method efficient mobile edge computing assisted task offloading using generative adversarial network (MEGAN) based on task representation learning and federated optimization for lightweight task recognition and energy consumption optimization of mobile edge computing (MEC) in 5G/6G transportation networks. The extended dataset of tasks is constructed based on generative adversarial network (GAN) to overcome the problems of data model overfitting and sample imbalance. A task preprocessing model between the edge server and the mobile users is established by using the federated deep learning with the knowledge distillation. The task classification accuracy, energy consumption of signal transmission and data computing are the optimization objectives to realize the MEC and lightweight application deployment. Experimental results show that compared with other state-of-the-art vehicular task offloading methods, the MEGAN method has great potential to promote the efficiency and energy consumption optimization of new transportation service processing in the future.