If the first shot ends the threat, shooting two more is not legal. If the second shot stops the attack, following up with a head shot is certainly not warranted or legal.
All this is contingent on your being aware that the threat has been negated. Reaction time, lack of response by the threat to vital hits, tunnel vision, etc. all come into play so that even after the threat ends, you may keep shooting because you either 1) don't know the threat ended or 2) are unable to stop firing off an additional round.