your follows and your saved relays are kept in a NIP-02 record:
https://github.com/nostr-protocol/nips/blob/master/02.md
the NIP-02 document doesn't describe how relays are kept, but it's a quoted JSON string in the "content" field that decodes to:
{
"wss://domain1": {"read": true, "write": true},
"wss://domain2": {"read": true, "write": true},
...
}
your follows, meanwhile, are in the "tags" field like:
[
["p", "pubkey1"],
["p", "pubkey2"],
...
]