You’ll meet Hanbei for the first time at the Dilapidated Temple, to the right of the Temple. He will act as a training dummy, allowing you to practice the basic principles of the combat in Sekiro.
After Learning Mikiri Counter
Return to Hanbei again after learning the Mikiri Counter skill and he will offer to train you on how to utilize it.
After Learning Vault Over
Return to Hanbei once more after you learn the Vault Over skill, yet again he will train you on how to put it to use.
After Obtaining the Mortal Blade
Once you obtain the Mortal Blade, speak to him again to learn that he wishes for you to use it on him and to end his immortality at last. You’ll set him free at last and upon his death, will obtain the Hidden Tooth as a reward.