Two classes of non-weight modules over the twisted Heisenberg–Virasoro algebra