Grab your .sav file. In BGB the proper file is generated automatically, and in VBA-M you simply choose Export > Battery File.
Rename the .sav to sav.dat.
Using a hex editor, remove the last two lines of data from the .dat.
On your 3DS, export your save data. We used JKSM!
On a 3DS with Crystal Clear installed and using JKSM, navigate to Crystal Clear and select Export Save.
You will be prompted to create a folder – remember the name!
Turn off your 3DS and put its SD card into your computer (or use an FTP client).
Navigate to the folder made with JKSM and replace that sav.dat in that folder with the one you made. Note that the folder in the root of your SD will be JKSV, not JKSM.
Back on your 3DS, launch JKSM and import the save data!
Note: Any dumped 3DS save renamed with a .sav file extension will work in your emulator!