How do I upgrade an electrical engine?

You first need to craft a Soldering Iron and at least one Circuit Board on a carpenter. The size of the circuit board determines how many tubes can be crafted onto it – one, two, and three respectively.

Right-clicking with the soldering iron will bring up a custom (and not very self-explanatory) crafting screen.

First place your desired Electron Tubes on the left. The text beside each slot will tell you what that type of tube will accomplish, and how many of them can be on a single circuit board. Once you have the set of tubes desired, put your target circuit board in the top-right slot – it will move immediately to the bottom-right slot and the tubes will disappear. The tooltip for the crafted circuit board will change to indicate its new effects. Note that putting the board in last can be important – if you put it in first, then it will craft as soon as you place the first tube on the left, which might create a board you didn't intend if you placed the wrong tube or wanted multiple tubes. You cannot solder additional tubes onto the larger boards afterwards.

Once you have your soldered board, put it in the engine. To remove it, you need the soldering iron again – drag it over the installed board and click to uninstall it. Breaking an engine while it has a circuit board installed will destroy the board.