Rule set username after changed user email
You can look at this: 
https://api.drupal.org/api/drupal/modules%21user%21user.module/function/user_save/7

It will run after a user is created and if a user is edited.   You can update the data as required.