Mechanism for the elimination of water:
The oxygen consume one of its lone pairs to make the new O-H bond and the electrons in the N-H bond end up on the nitrogen like a lone pair. An acid catalyst is availabe, but is not needed for this division of the mechanism - nitrogen is a good nucleophile and even though the amine is neutral, it is adequately nucleophilic to attack the carbonyl group without the requirement for acid catalysis. The intermediate acquired is the structure one would suppose from nucleophilic addition alone, but the reaction does not end there. Now the oxygen atom is protonated through the acid catalyst and gains a positive charge. Because oxygen is electronegative, a positive charge is not favored and thus there is a strong drive to neutralize the charge. This can be completed if the bond to carbon breaks and the oxygen leaves like part of a water molecule. Hence, protonation has turned the oxygen into a good leaving group. The nitrogen assists the departure of the water via using its lone pair of electrons to make a π bond to the neighboring carbon atom and a positive charged intermediate is formed (Step 4). The water now works like a nucleophile and removes a proton from the nitrogen like that the lone pair of nitrogen is restored and the positive charge is neutralized (Step 5).
Figure: Mechanism for the elimination of water.
In general, a molecule of water has been lost in this 2nd part of the mechanism. Acid catalysis is significant in making a good leaving group. If protonation did not take place, the leaving group would have to be the hydroxide ion that is much more reactive molecule and a poorer leaving group.
Even though acid catalysis is significant to the reaction mechanism, very much acid can actually hinder the reaction. This is since a high acid concentration leads to protonation of the amine, and stops it from acting like a nucleophile.