Shield bash is done by holding

for a moment and releasing when not holding a secondary weapon. This can be done in any layout, on any foe. You can even lead a foe down a narrow hallway and hit the same enemy 50 times. You'll know it counted if the enemy is knocked back.
Be aware that all 50 hits need to be done in the same play session, but not necessarily within the same dungeon run. Progress is reset when you close the game. The achievement unlocks as soon as the 50th hit is recorded.