I looked through the API but didn’t see any way to register a callback if a file is renamed from within the editor or File explorer. Maybe I missed it.
@tgrosinger’s excellent Recent Files plugin is a great example of where this would be useful to have. There’s an open issue for it already.
I don’t know how officially supported this is, but app.vault.on("rename", function(file, oldname) {}) will notify you of renames done from Obsidian’s file manager or pane title fields. It does not notify about renames initiated from outside of Obsidian.