Hello!
I, too, found this hard to track down exactly how the sequence of events worked.
CanActivateAbility() can be found in GameplayAbility.h at line 285 for me. This is not exposed to BP so you will have to do that yourself.
You can see how the TryActivateAbilityByClass() is used in AbilitySystemComponent_Abilities.cpp at line 1309 and remove the portions that try to activate the ability replacing it with the CanActivateAbility() to get a return. It’s used in that implementation at line 1387 in AbilitySystemComponent_Abilities.cpp