Galaxy formation as a cosmological tool – I. The galaxy merger history as a measure of cosmological parameters