A 38-year-old man has been convicted of sexually assaulting a young girl in Dunfermline over a four-year period.