Evolution of galaxy stellar masses and star formation rates in the EAGLE simulations