Solution 1:

Use custom YouTube SPF events defined by the youtube script:

window.addEventListener("spfrequest", function(e) { console.log("requesting new page") });
window.addEventListener("spfprocess", function(e) { console.log("new page is processed") });
window.addEventListener("spfdone", function(e) { console.log("new page is displayed") });

Tip for Chrome users to find such events:
Use DevTools → Elements panel → Event Listeners pane

On newer versions of Chrome:
Use DevTools → Sources panel → Event Listeners (not breakpoints)