The animation blueprint should be checking all the time. That’s what the ‘Event Update Blueprint Animation’ node in the animation blueprint’s Event Graph is doing. There is no need to keep constantly casting, because you can cast once on initialization (see the reference image I included) and store the player pawn as a variable for future use. So you only need to cast once. Casting is expensive and runs the risk of drawing a null result under the wrong circumstances, which can crash your game if you’re not careful. Casting dozens of times per second, while your game is running, is not something you want to do.
Also, it sounds like you’re trying to manipulate your animation blueprint from your pawn blueprint. That’s backwards from how that is typically handled. If you’ve properly linked your animation blueprint and the pawn, and your animation blueprint is monitoring for changes in the bool variable on your pawn blueprint, then everything else should take care of itself.