Check the wiring on the transmission.
P0171 and P0174 are both fuel system DTC's The Adaptive Fuel Strategy continuously monitors fuel delivery hardware. The test fails when the adaptive fuel tables reach a rich calibrated limit.
Possible causes are Fuel system, Excessive fuel pressure, Leaking/contaminated fuel injectors, Leaking fuel pressure regulator, Low fuel pressure or running out of fuel, Vapor recovery ststem, Induction system, EGR system, Base Engine.