For glossaries to work, the script makeglossaries has to be called. Overleaf uses the rules defined in a file latexmkrc to detect which scripts to called, and uses a default file given here when no such file is present in your project. According to these default rules, makeglossaries is called when there is a .glo or .acn file present after the first run of PDFLaTeX. However, for this specific case, we want to run makeglossaries on a .slo file to produce a .sls file*. So you just need to add this to the rules:
add_cus_dep('slo', 'sls', 0, 'makeglossaries');
Edit: *Actually, we should have a rule that detects whether the .aux file contains @istfilename{...} in order to determine if makeglossaries is required. However, that's not the way how latexmk works.
tl;dr
Add the following file to your Overleaf project and call it latexmkrc:
# support for the glossaries package:
add_cus_dep('glo', 'gls', 0, 'makeglossaries');
add_cus_dep('acn', 'acr', 0, 'makeglossaries');
add_cus_dep('slo', 'sls', 0, 'makeglossaries');
sub makeglossaries {
system("makeglossaries $_[0]");
}
# support for the nomencl package:
add_cus_dep('nlo', 'nls', 0, 'makenlo2nls');
sub makenlo2nls {
system("makeindex -s nomencl.ist -o \"$_[0].nls\" \"$_[0].nlo\"");
}
# from the documentation for V. 2.03 of asymptote:
sub asy {return system("asy \"$_[0]\"");}
add_cus_dep("asy","eps",0,"asy");
add_cus_dep("asy","pdf",0,"asy");
add_cus_dep("asy","tex",0,"asy");
# metapost rule from http://tex.stackexchange.com/questions/37134
add_cus_dep('mp', '1', 0, 'mpost');
sub mpost {
my $file = $_[0];
my ($name, $path) = fileparse($file);
pushd($path);
my $return = system "mpost $name";
popd();
return $return;
}

mainglossary isn't used. – Nicola Talbot May 18 '18 at 13:07\makeglossariesbefore the definitions. (Doesn't make much difference in this case, but you will notice a problem if you use theseekey, so it's best to get in the habit of use\makeglossariesfirst.) – Nicola Talbot May 18 '18 at 13:31