Energy companies that bill customers who leave for another provider could face fines, the economy ministry has warned.