Theory Of Integrated Two-Cavity Amplifier For Large Gain Quantum-Limited Qubit Measurements