You can use functional API of Tensorflow(keras) to solve this problem. The following pseudo code might help.
inputs = tf.keras.Input(input_shape = ...) # Specify input shape
output_1 = M1(inputs)
output_2 = M2(output_1)
new_model = tf.keras.Model(inputs = inputs, outputs = output_2)
new_model.summary( ) # Verify your total trainable parameters
model.compile(...)
model.fit(...)
Hope this will solve your issue.