how do i find the amount of moles of H2O in a hydrate?

Do you mean how do you KNOW the number of moles H2O in a hydrate or how do you determine the number of moles from experimental data?

For #1, experience.
For #2, calculate number moles of the salt. Calculate number of moles H2O from the experiment. Then find the moles H2O/1mole salt.