Use generatization on Administration.Account, not System.User. You can copy & alter Admin pages & microflows to include your Trainee attributes.
As Michal Mesároš suggested, it is recommended to use Administration.Account as the generalization of Trainee and to utilize the pages and microflows provided in the administration module; however, the issue you are facing is caused by the fact that you are trying to log in as a trainee that has no user role (as suggested by the error message). I would assume that you might have forgotten to add a Reference Set selector to the Trainee_NewEdit page in order to assign at least one user role to the Trainee you are trying to log in with. If you look at the System.User entity (that you are using as a generalization for Trainee you’ll find that it is associated to System.UserRole. Mendix uses that association to determine what permissions your Trainee (User) has.
Thanks for the answers. Is there a manual for this I have search in the Academy but I can’t find it.