A Scottish Labour government would work “hand in hand” with the EU, Anas Sarwar has said.