Here’s how you know:
Does the church adhere to the Bible and preach the truth from it? In other words, do they not cut things out, add things, or preach against Scripture?
Are they baptizing someone who is proclaiming faith in Jesus Christ alone for salvation?
If the answer to these questions is yes, then the baptism is valid.