Transition metal monolayer or bilayer: ferromagnetism versus lattice parameter