You have to get your form stamped at the airport before check-in, so you can show any of the goods exported on request, even if you are going to place them in checked luggage.
For this reason, even if you have a layover in the EU on your way out, you must get the stamp at the airport where you will check in.
The official rules from France are here, section 3.II.D, articles 47 and 48. They state that you can/must get the stamp at the first airport of your itinerary out of the EU, even if there are layovers inside the EU, if:
- the layover is less than 3 hours ("can")
- or your luggage is checked-through to its final destination ("must")
So, in your case (provided the two flights are on a single ticket), you should get the stamp in Berlin, before checking in. Remember to arrive early, in many airports there are often long queues at the tax refund desk, and you still need to check in after that and before the check-in deadline.
Also as noted by Mark Johnson, take into account the location of the tax refund desk which may be in a different area, and its opening hours.
The Berlin airport website says something which I find unusual:
Please follow this procedure if you want to have the VAT refunded:
Private individual with goods in checked baggage
- Go to your check-in counter and receive your baggage labels.
- Then take your labelled baggage to the customs counter at check-in island 7. The export certificate for the goods in your checked baggage is issued at the customs counter. Baggage is taken away at these counters.
Private individual with goods in hand luggage
- If you are transporting the goods concerned exclusively in your hand luggage, your checked baggage can be taken away directly at the check-in counter.
- After passing through the security checkpoint, please go directly to the customs hand luggage clearance in the security area.
That procedure is definitely less prone to fraud than others but it seems unusual to me, so take that into account.