My bad, I figured it out. In order to work the class only needs to extend WireData. So the following example works.
<?php
class MyClass extends WireData {
public function ___someFunction() {
// Do something
}
}
// ready.php
$this->addHookBefore('MyClass::someFunction', function($event) {
// some customization
});