A pervert who sexually abused a young boy during night time visits to an East Lothian beach has been warned he is facing a lengthy jail term.