How to change the code in Arduino with another Arduino?

The usual place to store this type of parameters is indeed in EEPROM.

I'm not sure why you don't want this to be done when the 1st Arduino is running. But the 1st Arduino needs to be running. Now this is not a train smash. You can reset the 1st arduino so it will execute setup(). In setup() you can send a command to the 2nd Arduino after which the 1st Arduino will send the parameters and you can store them one by one in EEPROM. If the 2nd Arduino does not reply on the command, you can either wait or after e.g. 5 seconds finish setup() and loop will be started with the old parameters.

It can also be done from loop() in the 1st Arduino. It prevents the need for resets. You can use a button that, when pressed, will send the command to the 2nd Arduino and the second Arduino will give the parameters.

And lastly you can use the 2nd Arduino to 'create' the parameters, let it send the parrameters to the 1st Arduino which stores it and when the 1st Arduino has received all modified parameters it will start using them.

How do your Arduinos communicate?