My mother told me to behave myself.

Literal

Mother [topic-は] me [to-に] well-mannered do [indirect-command-ようにと] said

行儀よくする = 'to behave well / act with good manners.' 行儀 (ぎょうぎ) = manners/behavior. よく = well (adverb). ~ようにと言った = standard indirect command.