How do you know when the animal knows the behavior?
Sometimes this question is asked in a different way: Will I have to continue clicking and treating forever? In asking either question, what we really want to know is: When are we done? When can we call a behavior trained once and for all?
The answer to these questions is (like most not-so-simple questions): It depends.
First, a trainer needs to verify that the animal agrees with you on which behavior is being cued and reinforced. While a behavior may be offered repeatedly and in response to the same cue, the possible difference between what the animal perceives as the behavior and the cue and what the trainer perceives can be vast. A trainer may believe that her dog understands the verbal cue "sit" for a sit, as the dog always sits when she says it. The dog, however, may also always bark, then sit. And she may do so whenever her handler raises her right hand slightly while saying "sit" (the motion being the remnants of the targeting gesture she used when shaping the sit in the first place). But only when they're indoors. For the dog, the trainer's unconscious raising of her right hand slightly indoors means "bark and sit." The spoken word "sit" means nothing.
To test that the cue you're using is the cue for the behavior that you're getting, click and reinforce the selected behavior in as many different environments as possible. Change your position each time you cue it. Raise your criteria and click only the behavior when it is performed without the accompaniment of extra behaviors (that silly bark).
When your dog performs a sit when you say "sit" no matter where or how you cue it, does it know the behavior? That depends (of course). As Karen Pryor points out, "Living things are variable. Behavior, therefore, is always changing: it's always either a little bit better or a little bit worse. As a trainer, all you can do is keep on keeping it where you need it, more or less." Even "known" behaviors, in other words, change over time. Nothing stays the same, and reliability is always relative.
Kay Laurence, of Learning About Dogs, goes so far as to say, "I do not ever consider the dog 'knows the behavior.' I can certainly see there are many situations where I get the required response, without hesitation, and the behavior is to the required quality, consistently. But should the situation change, any one of those criteria may change."
In real life, we want a cued behavior to work every time. But real life is not static; it is composed of ever-changing, and therefore constantly increasing, criteria. As Kay writes, "You 'know' your left from right, but are you sure I can't cause you to err? If I overloaded you with stress and information so that you would make a mistake—do you then 'know it'?"
While training dolphins for behaviors to be performed for audiences, Karen Pryor found that the desired level of "perfection" for any behavior needed to be several steps behind the level targeted by the ongoing training. As Kay explains, in terms of training dogs for competitive sports, "I consider my training time as still building the behavior and the competition time, in comparison to the training, is the one of the lower criteria situations. Since the criteria is lower, the dog can perform more behaviors fluently and of the required standard. At the next training session, I find a new criteria to add to the training, which is still clicked and rewarded for maintenance in a variety of environment."
So, when does the animal know the behavior? That depends on the animal and the environment. And as both the animal and the environment are always changing, the performance of the behavior is always somewhat conditional. The more you train with the expectation of ever-changing conditions, the better your animal will "know" the behavior.