come to think of it~
Used to introduce a thought that has just occurred to the speaker, often triggered by something in the conversation.
そう言えば literally means 'if one says that', but in conversation it functions like 'come to think of it' or 'now that you mention it'. You use it when a remark or situation suddenly reminds you of something related. It's a natural way to shift the topic or add an afterthought.
It is quite common in everyday speech and casual writing. It often carries a tone of mild surprise or realization, as if you've just remembered something. You can use it with friends, family, or colleagues, though in very formal speech you might prefer expressions like 'そう言われれば' or just 'ところで' for changing topics.
Note that it's set phrase, so you don't need to analyze its components. Just place it at the start of your sentence, and it will sound natural.