Holographic Fermi and non-Fermi liquids with transitions in dilaton gravity