Use email address as username
I believe you're looking for the conveniently named useEmailAsUsername config setting.

When that is set to true, any new user that is saved with a valid email address will have that copied over to the username field as well.