How can I set Hotkeys for enabled units by triggers such as Sheep or heroic units?

With the trigger effect “Enable/disable Object”, we can set a certain unit trainable or locked.

I turned Sheep on at Town Center.

However, no Hotkey for it is there.

I used another effect “Modify Attribute – Hotkey ID”, but it didn’t work. I have no idea how it works.

When I enabled a heroic unit, it also didn’t have any Hotkeys.

How can I set it?

Hey, there! I hope this answer is still useful.
They hotkey ID trigger lets you enter an integer, right? Ok
Every unit has an integer hotkey ID. How do you know this ID? Open AGE3, included in the game, which is in Tools_Builds. If you have never opened it, you’ll need to fill up some data, like, where is your game installed or where are the string locale files.
Now, go to the units tab and there, you’ll find info about units. The info you are looking for is ‘Hotkey*’. That’s they hotkey ID of the unit.
If you want to train a new unit in the barracks, I’ll suggest you asign it the Barracks huskarl hotkey, 16748 or the eagle warrior hotkey id, 16671
If you want to train a new unit in the stable, I suggest using Battle elephant, 16733, or Steppe lancer, 16746
If you want to train a new unit in the archery range, I suggest using slinger, 16743, or genitour, 16417

Do you know where exactly the hotkey is? 'Cause I can’t find it.

You have to find it using Age. If you are setting a hotkey for a unit in the Castle, I suggest using the Mercenary Kipchak key