Epitaxial buried 16 a Co/3 a Tb and 18 a Co/3 a Ho films exhibit a continuous (second order) spin reorientation transition (SRT) as a function of temperature near room temperature. The magnetism and the transition from a perpendicular to an in-plane magnetized state with increasing temperature is studied ex situ by SQUID magnetometry, X-ray circular dichroism and by polar magneto-optical Kerr effect. The uniaxial second- and fourth-order anisotropy constants are determined by recording magnetization loops at tilted angles with respect to the film plane. The second-order uniaxial anisotropy favoring out-of-plane magnetization decreases almost linearly with increasing temperature near the SRT, similar to the known bulk behavior of Co. The fourth-order anisotropy constant is nearly constant and positive. From this the tilted angle of the magnetization is calculated as a function of temperature.