The former one
Ex- has two main uses. The first signals someone or something that held a role before and no longer does: ex-president, ex-wife, ex-employee. In this use it always takes a hyphen when attached to a title or relationship noun. It is the prefix of what was but is no longer.