The concept behind 3-4-2-1 is to outnumber midfield and to pass the ball to its AML/AMR in order to start things happen. Its strange he uses AML/AMR and not 2 AMC.
Therefore you have to make sure that your opponent will not outnumber you at midfield. You can defend with 3 DCs and 2 DML/DMR. Then to put 3-4 on midfield and 1 ST with probably 1 AMC behind him. ( you have literally 5-4-1, because your DML/DMR will mark his AMR/AML as the fullbacks would.)

But for me the most important to counter this formation is to put pressure allover the pitch. It doesn't matter if you play 4-5-1, 4-3-3, 3-5-2 or whatever, he will score against you, unless you don't allow your opponent from reaching the ball to his AMs. There is when things start to happen. So put someone on his AMR/AML and make sure the ball don't reach them. Choose any formation you want but, put pressure all over the pitch. It's key to counter these kind of formations.