Is it possible to change a term slug before being saved to the database?

You can use the pre_insert_term filter to do just this

https://developer.wordpress.org/reference/hooks/pre_insert_term/

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)