Tell, don't show: Declarative facts influence how LLMs generalize