Electron transfer and energy transfer through bridged systems. I. Formalism