Time-dependent framework for energy and charge currents in nanoscale systems