You can interface each board by connecting the pins Tx and Rx properly. If you are using the Arduino Expansion Board for Edison, you have to connect the Tx pin to the Rx pin of the Arduino MEGA, and the Rx pin to the Tx pin of the Arduino MEGA.
Then, you could program each board through the Arduino IDE in order to send and receive serial data. If you prefer to use the Eclipse IDE to program the Edison, you might find the MRAA library useful for this purpose. A UART example can be checked in the following site: mraa/Uart-example.cpp at master · intel-iot-devkit/mraa · GitHub