Poincar\'e--Melnikov method, arithmetic properties of frequencies, transverse homoclinic orbits