Alternatively to what @laurentiu said, you could do it by creating a file called init-custom.php in /apps/ and put this code in it:
<?php
function changePageTitleFormatHook() {
$currentTitle = controller()->getData('pageMetaTitle', '');
if (strpos($currentTitle, '|') === false) {...