Quantum simulation of the Kibble-Zurek mechanism using a semiconductor electron charge qubit