The Scottish Government will call a second independence referendum if the UK opts for a so-called "hard Brexit", Nicola Sturgeon has warned.