Dynamical spontaneous scalarization in Einstein-Maxwell-scalar theory