Battery current reduction
Heat production is caused by voltage drop on your LM7812 regulator.

When your voltage source produces 20V your regulator has to drop 8V to get 12V.

You schematic has two BC547 transistors, they have maximum current 100mA. That circuit on schematic can't consume not more than 250mA. It probably consumes about 100mA total.

Power lost on regulator at 250mA is 250mA * 8V = 2000mW = 2W of heat. Thats not a lot, but enough to heat up regulator (it's just few grams of metal) to "untouchable" temperature very fast.

You just have to add some heatsink.

Something like this should be enough for 2W:



(I took image from here)

but you can add bigger heatsink to keep temperature lower.

Keep in mind that LM7812 metal part of casing is electrically connected with GND pin inside device..

LM7812 operating temperature range is 0-125°C, so it can handle much more than your finger (I think "untouchable" temperature starts at 50-60°C).

Your capacitors are fine. 1A current is just maximum operating current for LM7812.