For Windows 95, 98, and ME, the secret seems to be the part of the Windows Registry labelled HKEY_LOCAL_MACHINE. In this folder you'll find a sub-directory named Enum, which contains sub-references to the specific hardware components found in your PC, regardless of whether or not they are enabled in each hardware profile, and thus applicable to all users. It covers motherboard devices, BIOS, PCI cards, USB devices, your hard and floppy drives, any SCSI devices, monitor, mouse, and so on.
Delete this Enum folder, then power down your PC. Then install your new motherboard. The safest way to do an 'over the top' motherboard upgrade with any operating system is to start with just the graphics card installed. Then, when you boot up for the first time with the new board in place, a new Enum folder will be created, and all your new motherboard devices should then be detected in sequence and added to it. I can't guarantee that this will always work, but it seems to be a trick that's fairly well-known by Win 98 users