In situ observations of multistage electron acceleration driven by magnetic reconnection