Understanding gel-to-crystal transitions in supramolecular gels