SUBSTITUTE({field name}, " ", "-")
It is documented in the formula field reference.
Depending on your source, you might want to do other substitutions. For example, if your source might have punctuation, accents, or other special characters, you might want to change those characters as well. You can search these forums for other formulas for creating slugs.