The pronoun you (and its other forms) can be used as a generic or indefinite pronoun, referring to a person in general. A more formal equivalent is the indefinite pronoun one (reflexive oneself, possessive one's). For example, you should keep your secrets to yourself may be used in place of the more formal one should keep one's secrets to oneself.