This is actually quite simple.
To increase your hp, create an upgrade that increases the hp for the hero. If you dont want the upgrade number icon to appear at your damage/armour icons, the ones that tell you your unit's armour type and damage, then set the upgrade type to NONE.
Using triggers:
Event
A unit dies
Condition
((Level of "your ability" for (killing unit)) equal to 1) and (((Killing unit) is A Hero) Equal to True)
Actions
Hero - Modify Agility of (Killing unit): Add (1/5) ----------> in this case it means 0.2
Player - set the current research level of "your health upgrade" to ((Current research level of "your health upgrade" for (Owner of (Killing unit)))+1) for (Owner of (Killing unit))
This is a very simple trigger for a one level spell for a hero. The bonuses also cannot be removed if the hero dies. However it can be modified to be a multi level spell. If you want the bonuses to be able to be removed, it will require more triggering and as for me I would use item abilities to do this.
You can modify the number of level of the upgrade you are using to limit or make it near limitless (give it 100 levels to do this)
Hope this helped