OnGetBranchAbility is deprecated (or should be). Just add the Function Binding by clicking on the + next to the Ability on the branch task.If you want to do it in C++ just basically copy the name of the method you would get in blueprints, add it to your Ability class, and make sure it’s a UFUNCTION.
You can step through the BindDynamicProperties method on the Branch task to watch it try and find the method.