What say the doc :
also $this is not callable in this context as you're not in an object.
In order to get the hook working, you should write the hook in _init.php :
function example1(HookEvent $event) {
$page = $event->arguments[0];
wire('session')->message("Hello World 2 ! You saved {$page->path}");
}
$pages->addHookAfter('Pages::save', null, 'example1');
And in admin.php, add :
include("./_init.php");
Now go to in backend, and save a page, the message 'Hello World 2 ! You saved /your/page/' should appear.