How can I transfer a custom keyboard layout from one computer to another?

Layout definitions are saved in Layout DLL files. These files reside in the Windows's standard System32 directory.

If you don't know the DLL filename of your keyboard then get Keyboard Layout Manager on the computer you wish to copy the layout from. The program displays the keyboard name and DLL filename.

Copy that DLL from Windows/System32 and Windows/SysWOW64, and paste on the new computer.

Then it should be in the registry. Copy the following in a text file and save with ".reg" extension. (Also you can export the entry from your old computer):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Keyboard Layouts\A0030409]
"Layout File"="yourdllfile.dll"
"Layout Text"="Pirate Language"
"layout id"="00C7"

The Layout File and Layout Text should match yours. The folder name and layout id, I think can be any not already in use. Execute it afterwards and you're done.

The layout should become selectable in the Windows keyboard language settings. Restart session/windows before and/or after picking it for the first time.