Reference

Guide

user.changeName:before

$user, $name

Example

/site/config/config.php
return [
    'hooks' => [
        'user.changeName:before' => function ($user, $name) {
            // your code goes here
        }
    ]
]