Common trajectory methods for the calculation of differential cross sections for inelastic transitions in atom(ion)-atom collisions. I. General theory