Assuming it's driven by 12v DC, the easiest way is to connect to the 12v. supply switched from the ignition switch. I think that's maybe white or red/black wires, but check with a meter or light-bulb.. That way records the time the switch is "on", not necessarily quite the same as engine running hours, but good enough unless you make a habit of not switching off after an engine run.
As Early bird says connect the positive to the red/black wire (after the fuse if fitted) supplying the tacho, any other gauges and warning lights (Some diagrams show red/ green wire)
Connect the negative to the black wire supplying the tacho and any other gauges